# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ContainerAnalysis.V1alpha1.Model.LayerDetails do
  @moduledoc """
  Details about the layer a package was found in.

  ## Attributes

  *   `baseImages` (*type:* `list(GoogleApi.ContainerAnalysis.V1alpha1.Model.BaseImage.t)`, *default:* `nil`) - The base images the layer is found within.
  *   `command` (*type:* `String.t`, *default:* `nil`) - The layer build command that was used to build the layer. This may not be found in all layers depending on how the container image is built.
  *   `diffId` (*type:* `String.t`, *default:* `nil`) - The diff ID (sha256 hash) of the layer in the container image.
  *   `index` (*type:* `integer()`, *default:* `nil`) - The index of the layer in the container image.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :baseImages => list(GoogleApi.ContainerAnalysis.V1alpha1.Model.BaseImage.t()) | nil,
          :command => String.t() | nil,
          :diffId => String.t() | nil,
          :index => integer() | nil
        }

  field(:baseImages, as: GoogleApi.ContainerAnalysis.V1alpha1.Model.BaseImage, type: :list)
  field(:command)
  field(:diffId)
  field(:index)
end

defimpl Poison.Decoder, for: GoogleApi.ContainerAnalysis.V1alpha1.Model.LayerDetails do
  def decode(value, options) do
    GoogleApi.ContainerAnalysis.V1alpha1.Model.LayerDetails.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.ContainerAnalysis.V1alpha1.Model.LayerDetails do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
